<%@ tag description="Allows to upload a new file and attach it to an issue" pageEncoding="ISO-8859-1" %>
<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ attribute name="issueClass" type="java.lang.Class" required="true" %>
<c-rt:set var="sessionUser" value="<%= org.internna.iwebmvc.security.UserManager.SESSION_USER %>" />
<c-rt:set var="subsession_id" value="<%= org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter.SUB_SESSION_COOKIE %>" />
<c-rt:set var="subsession_path" value="<%= org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter.SUB_SESSION_COOKIE_PATH %>" />
<input id="attachmentParentIssue" name="attachmentParentIssue" type="hidden" />
<input id="attachmentParentIssueAlias" name="attachmentParentIssueAlias" type="hidden" />
<iwebmvc:document entityClass="${issueClass}" path="attachments" id="_newdoc" supportsEditionMode="true" />
<div style="text-align:right;padding-top:5px">
    <span id="issueAttachmentLoadingContainer" style="display:none"><img src='<c:url value="resource.iwebmvc?file=images/loading.gif" />&${requestScope[subsession_path]}=${requestScope[subsession_id]}' alt='' /></span>
    <iwebmvc:button buttonId="newAttachmentButton" label="ui.issue.actions.user.attachment.save" buttonIcon="/resource.iwebmvc?file=/images/common/save_${sessionScope[sessionUser].theme}.gif">
        attachFileToIssue("${iwebmvc:inferDWRConvertedJavascriptClass(issueClass)}", byId("attachmentParentIssue").value, byId("attachments_newdoc").value, byId("attachmentParentIssueAlias").value, "<iwebmvc:message argMessage="ui.issue.main.tabs.screenshots" />", "<iwebmvc:message argMessage="ui.issue.main.tabs.file" />");
    </iwebmvc:button>
</div>